package com.b2j.language;

import com.b2j.base.ErrorManager;
import com.b2j.base.Lexema;
import com.b2j.base.MainTools;
import com.b2j.base.Routine;
import com.b2j.base.Token;

// PROGRAM ID;

public class Program extends Routine {

	
	@Override
	public String generate(Lexema lexema) {

		lexema = MainTools.tools.nextLexema();
		if (lexema.tokenType == Token.ID) {
			
			MainTools.tools.programName = lexema.lexema;
			lexema = MainTools.tools.nextLexema();
			if (!(lexema.tokenType == Token.SEMICOLON))
				// If next to the ID of PROGRAM isn't an ';' 
				ErrorManager.unexpected(lexema);
				
		}else {
			// If next to the PROGRAM isn't an ID 
			ErrorManager.unexpected(lexema);
		}
		
		return "";
	}
	
	


}
